// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Login from '../views/Login.vue';
import Register from '../views/Register.vue';
import Home from '../components/Home.vue';
import UserManagement from '../views/admin/UserManagement.vue';
import RolePermManagement from '../views/admin/RolePermManagement.vue';
import RoleManagement from '../views/admin/RoleManagement.vue';
import PermManagement from '../views/admin/PermManagement.vue';
import MedInstManagement from '../views/admin/MedInstManagement.vue';
import FamilyManagement from '../views/admin/FamilyManagement.vue';
import FarmerManagement from '../views/admin/FarmerManagement.vue';
import ChronicReimbManagement from '../views/admin/ChronicReimbManagement.vue';
import ChronicPolicyManagement from '../views/admin/ChronicPolicyManagement.vue';
import ChronicCertManagement from '../views/admin/ChronicCertManagement.vue';
import HomeManagement from '../views/admin/HomeManagement.vue';
import CooperativeInstitution from '../views/admin/CooperativeInstitution.vue';
import ChronicDiseaseCategory from '../views/admin/ChronicDiseaseCategory.vue';
import AdministrativeRegion from '../views/admin/AdministrativeRegion.vue';
import AnnualFeeStandard from '../views/admin/AnnualFeeStandard.vue';
import CertificateChangeLog from '../views/admin/CertificateChangeLog.vue';
import FarmerPaymentDetail from '../views/admin/FarmerPaymentDetail.vue';
import PolicyAttachment from '../views/admin/PolicyAttachment.vue';
import FamilyPayment from '../views/admin/FamilyPayment.vue';
import ChronicReimbursementStatistics from '../views/admin/ChronicReimbursementStatistics.vue';
import ChronicReimbursementArea from '../views/admin/ChronicReimbursementArea.vue';

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    // {
    //     path: '/login',
    //     name: 'Login',
    //     component: Login
    // },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        redirect: '/home/home-management',
        children: [
            {
                path: 'home-management',
                name: 'HomeManagement',
                component: HomeManagement
            },
            {
                path: 'user-management',
                name: 'UserManagement',
                component: UserManagement
            },
            {
                path: 'role-management',
                name: 'RoleManagement',
                component: RoleManagement
            },
            {
                path: 'perm-management',
                name: 'PermManagement',
                component: PermManagement
            },
            {
                path: 'role-perm-management',
                name: 'RolePermManagement',
                component: RolePermManagement
            },
            {
                path: 'Med-Inst-management',
                name: 'MedInstManagement',
                component: MedInstManagement
            },
            {
                path: 'family-management',
                name: 'FamilyManagement',
                component: FamilyManagement
            },
            {
                path: 'farmer-management',
                name: 'FarmerManagement',
                component: FarmerManagement
            },
            {
                path: 'chronic-reimb-management',
                name: 'ChronicReimbManagement',
                component: ChronicReimbManagement
            },
            {
                path: 'chronic-policy-management',
                name: 'ChronicPolicyManagement',
                component: ChronicPolicyManagement
            },
            {
                path: 'chronic-cert-management',
                name: 'ChronicCertManagement',
                component: ChronicCertManagement
            },
            {
                path: 'cooperative-institution',
                name: 'CooperativeInstitution',
                component: CooperativeInstitution
            },
            {
                path: 'chronic-disease-category',
                name: 'ChronicDiseaseCategory',
                component: ChronicDiseaseCategory
            },
            {
                path: 'administrative-region',
                name: 'AdministrativeRegion',
                component: AdministrativeRegion
            },
            {
                path: 'annual-fee-standard',
                name: 'AnnualFeeStandard',
                component: AnnualFeeStandard
            },
            {
                path: 'certificate-change-log',
                name: 'CertificateChangeLog',
                component: CertificateChangeLog
            },
            {
                path: 'farmer-payment-detail',
                name: 'FarmerPaymentDetail',
                component: FarmerPaymentDetail
            },
            {
                path: 'policy-attachment',
                name: 'PolicyAttachment',
                component: PolicyAttachment
            },
            {
                path: 'family-payment',
                name: 'FamilyPayment',
                component: FamilyPayment
            },
            {
                path: 'chronic-reimbursement-statistics',
                name: 'ChronicReimbursementStatistics',
                component: ChronicReimbursementStatistics
            },
            {
                path: 'chronic-reimbursement-area',
                name: 'ChronicReimbursementArea',
                component: ChronicReimbursementArea
            },
            
            
        ]
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;